package com.bjsxt.livegoods.search.service.config;

import com.bjsxt.livegoods.es.dao.ProductDao4ES;
import com.bjsxt.livegoods.es.dao.impl.ProductDao4ESImpl;
import com.bjsxt.livegoods.dao.product.ProductDao;
import com.bjsxt.livegoods.dao.product.ProductDaoImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
import org.springframework.data.mongodb.core.MongoTemplate;

@Configuration
public class SearchConfiguration {
    @Bean
    public ProductDao productDap(MongoTemplate mongoTemplate){
        ProductDaoImpl dao=new ProductDaoImpl();
        dao.setMongoTemplate(mongoTemplate);
        return dao;
    }
   @Bean
   public ProductDao4ES productDao4ES(ElasticsearchRestTemplate restTemplate){
       ProductDao4ESImpl dao=new ProductDao4ESImpl();
       dao.setRestTemplate(restTemplate);
       return dao;
   }
}
